import LoginView from './../login';
import HomeView from "./../home";
import DeptView from "./../permission/dept";
import RolesView from "./../permission/roles";
import UserView from "./../permission/user";
import Page404 from './../404/page404.jsx';
import CourseView from "./../course"

const routes = [
  { path: "/", element: <LoginView /> },
  { path: "/login", element: <LoginView /> },
  {
    path: "/home", element: <HomeView />, children: [
      { path: 'dept', exact: true, element: <DeptView /> },
      { path: 'roles', exact: true, element: <RolesView /> },
      { path: 'users', exact: true, element: <UserView /> },
      { path: 'course/:pid', exact: true, element: <CourseView /> },
      { index: true, element: <UserView /> }
    ]
  },
  {
    path: "*", element: <Page404 />
  }
]

export default routes;

// 路由匹配是由优先级的。不是按写代码的顺序来匹配的。这v6.x的特点。
// /home/course
// /home/course/detail

// url: /home/course